﻿namespace Common.Core.Util.Log
{
    public class NlogLoggingService : ILogger
    {
        public void Log(string msg, string detail, LogLevel level, long timeInMillis)
        {
            switch (level)
            {
                case LogLevel.FATAL:
                case LogLevel.ERROR:
                    Serilog.Log.Error(msg + Environment.NewLine + detail);
                    break;

                case LogLevel.WARNING:
                    Serilog.Log.Warning(msg + Environment.NewLine + detail);
                    break;

                case LogLevel.DEBUG:
                    Serilog.Log.Debug(msg + Environment.NewLine + detail);
                    break;
                case LogLevel.INFO:
                case LogLevel.EXCLAMATION:
                    Serilog.Log.Information(msg + Environment.NewLine + detail);
                    break;
            }
        }
    }
}
